public class WordAndTag 
{

    @Override
    public int hashCode() {
	final int prime = 31;
	int result = 1;
	result = prime * result + ((pos == null) ? 0 : pos.hashCode());
	result = prime * result + ((word == null) ? 0 : word.hashCode());
	return result;
    }

    @Override
    public boolean equals(Object obj) {
	if (this == obj)
	    return true;
	if (obj == null)
	    return false;
	if (getClass() != obj.getClass())
	    return false;
	WordAndTag other = (WordAndTag) obj;
	if (pos == null) {
	    if (other.pos != null)
		return false;
	} else if (!pos.equals(other.pos))
	    return false;
	if (word == null) {
	    if (other.word != null)
		return false;
	} else if (!word.equals(other.word))
	    return false;
	return true;
    }
    private String word;
    private String pos;
    
    private WordAndTag(String word, String pos)
    {
	this.word= word;
	this.pos= pos;
    }
    
    public static WordAndTag newWordAndTag(String word, String pos)
    {
	WordAndTag newWordAndTag = new WordAndTag(word, pos);
	return newWordAndTag;
    }
    
    public String getWord()
    {
	return word;
    }
    
    public String getPOS()
    {
	return pos;
    }
    public String toString()
    {
	String output = "The word is: " + getWord() + " and the POS is: " + getPOS();
	return output;
    }
    
    
}
